<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@page session="true"%>

<!DOCTYPE html>
<html>
<head>
    <jsp:include page="./../util/configurationPage.jsp"/>
</head>
<title>Zarządzaj zadaniem</title>
<style>

</style>
</head>
<body class="bg-body" onload='document.loginForm.username.focus();'>
    <jsp:include page="./../util/navbar/navbarMain.jsp"/>
    <br>
    <div class="container">
            <div class="row">
                <div class="panel panel-primary col-lg-offset-2 col-lg-8">
                    <div class="panel-heading">
                        <h2 class="panel-title text-center">Zadnie do realizacji</h2>
                    </div>
                    <div class="panel-body">
                        <form:form role="form" cssClass="form-horizontal" commandName='doc' action="saveDoneTask" method='POST'>
                            <form:errors path="*" cssClass="alert alert-danger text-center" element="div" />

                            <div class="form-group">
                                <form:label cssClass="control-label col-sm-4" path="form">Identyfikator formularza:</form:label>
                                <div class="col-sm-8">
                                    <form:input cssClass="form-control" path="form" readonly="true" />
                                </div>
                            </div>
                            <div class="form-group">
                                <form:label cssClass="control-label col-sm-4" path="username">Utworzony przez:</form:label>
                                <div class="col-sm-8">
                                    <form:input cssClass="form-control" path="username" readonly="true" />
                                </div>
                            </div>
                            <hr>
                            <div class="form-group">
                                <form:label cssClass="control-label col-sm-4" path="department">Prześlij dalej do:</form:label>
                                <div class="col-sm-8">
                                    <form:select items="${flowsMap}" path="inDepartment" cssClass="form-control"/>
                                </div>
                            </div>
                            <hr>
                            <div class="form-group">
                                <form:label cssClass="control-label col-sm-4" path="name">Nazwa opisowa formularza:</form:label>
                                <div class="col-sm-8">
                                    <form:input cssClass="form-control" path="name"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <form:label cssClass="control-label col-sm-4" path="description">Opis / Informaca zwrotna:</form:label>
                                <div class="col-sm-8">
                                    <form:textarea cols="20" rows="10" cssClass="form-control" path="description"/>
                                </div>
                            </div>

                            <input class="btn btn-success pull-right" name="submit" type="submit" value="Wykonaj zadanie"/>

                            <input type="hidden" name="${_csrf.parameterName}"	value="${_csrf.token}"/>
                            <form:input type="hidden" path="documentId"/>
                            <form:input type="hidden" path="orbeonDocId"/>
                            <form:input type="hidden" path="department"/>
                        </form:form>
                    </div>
                </div>
	        </div>
	</div>
</body>
</html>